package com.shop.pojo;

import com.baomidou.mybatisplus.annotation.*;
import org.springframework.beans.BeanUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.ToString;

/**
 * 商品参数 
 * 
 * @author yukangkang
 * @email sunlightcs@gmail.com
 * @date 2020-10-30 13:16:29
 */
@Data
@ToString
@TableName("items_param")
public class ItemsParam implements Serializable {
	private static final long serialVersionUID = 1L;

		/**
		 * 商品参数id
		 */
		@TableId(value = ID, type = IdType.AUTO)
		private String id;
		/**
		 * 商品外键id
		 */
		@TableField(ITEM_ID)
		private String itemId;
		/**
		 * 产地 产地，例：中国江苏
		 */
		@TableField(PRODUC_PLACE)
		private String producPlace;
		/**
		 * 保质期 保质期，例：180天
		 */
		@TableField(FOOT_PERIOD)
		private String footPeriod;
		/**
		 * 品牌名 品牌名，例：三只大灰狼
		 */
		@TableField(BRAND)
		private String brand;
		/**
		 * 生产厂名 生产厂名，例：大灰狼工厂
		 */
		@TableField(FACTORY_NAME)
		private String factoryName;
		/**
		 * 生产厂址 生产厂址，例：大灰狼生产基地
		 */
		@TableField(FACTORY_ADDRESS)
		private String factoryAddress;
		/**
		 * 包装方式 包装方式，例：袋装
		 */
		@TableField(PACKAGING_METHOD)
		private String packagingMethod;
		/**
		 * 规格重量 规格重量，例：35g
		 */
		@TableField(WEIGHT)
		private String weight;
		/**
		 * 存储方法 存储方法，例：常温5~25°
		 */
		@TableField(STORAGE_METHOD)
		private String storageMethod;
		/**
		 * 食用方式 食用方式，例：开袋即食
		 */
		@TableField(EAT_METHOD)
		private String eatMethod;
		/**
		 * 创建时间
		 */
		@TableField(CREATED_TIME)
		private Date createdTime;
		/**
		 * 更新时间
		 */
		@TableField(UPDATED_TIME)
		private Date updatedTime;




	public final static String ID =  "`id`";
	public final static String ITEM_ID =  "`item_id`";
	public final static String PRODUC_PLACE =  "`produc_place`";
	public final static String FOOT_PERIOD =  "`foot_period`";
	public final static String BRAND =  "`brand`";
	public final static String FACTORY_NAME =  "`factory_name`";
	public final static String FACTORY_ADDRESS =  "`factory_address`";
	public final static String PACKAGING_METHOD =  "`packaging_method`";
	public final static String WEIGHT =  "`weight`";
	public final static String STORAGE_METHOD =  "`storage_method`";
	public final static String EAT_METHOD =  "`eat_method`";
	public final static String CREATED_TIME =  "`created_time`";
	public final static String UPDATED_TIME =  "`updated_time`";


	public final static String ID_COMMENT =  "商品参数id";
	public final static String ITEM_ID_COMMENT =  "商品外键id";
	public final static String PRODUC_PLACE_COMMENT =  "产地 产地，例：中国江苏";
	public final static String FOOT_PERIOD_COMMENT =  "保质期 保质期，例：180天";
	public final static String BRAND_COMMENT =  "品牌名 品牌名，例：三只大灰狼";
	public final static String FACTORY_NAME_COMMENT =  "生产厂名 生产厂名，例：大灰狼工厂";
	public final static String FACTORY_ADDRESS_COMMENT =  "生产厂址 生产厂址，例：大灰狼生产基地";
	public final static String PACKAGING_METHOD_COMMENT =  "包装方式 包装方式，例：袋装";
	public final static String WEIGHT_COMMENT =  "规格重量 规格重量，例：35g";
	public final static String STORAGE_METHOD_COMMENT =  "存储方法 存储方法，例：常温5~25°";
	public final static String EAT_METHOD_COMMENT =  "食用方式 食用方式，例：开袋即食";
	public final static String CREATED_TIME_COMMENT =  "创建时间";
	public final static String UPDATED_TIME_COMMENT =  "更新时间";


	public static ItemsParam of(Object obj) {
		ItemsParam e = new ItemsParam();
		BeanUtils.copyProperties(obj, e);
		return e;
	}

	public static QueryWrapper<ItemsParam> queryWrapper(Object obj) {
		return new QueryWrapper<>(of(obj));
	}



}
